package com.learn.excel.core.consts;

import com.learn.excel.hawkeye.config.HkRedisConfig;

/**
 * @author anri
 * @date 2020/9/29 10:35
 */
public final class RedisConst {

    // 使用项目名称作为前缀
    public static final String _PREFIX = HkRedisConfig.getRedisCachePrefix();

    /************************ 数据处理缓存相关 ************************/
    // 所有的测点信息
    public static final String TGT_LIST = _PREFIX + "tgt:list";
    // 每个类型对应的指标对象
    public static final String TYP_QUO = _PREFIX + "typ:quo:";
    // 测点状态
    public static final String TGT_STATUS_ON = _PREFIX + "tgt:status:online:";
    // 缓存测点告警信息【后缀为测点id+指标编号】
    public static final String TGT_STATUS_WARN = _PREFIX + "tgt:status:warn";
    // 项目id和通讯编号与测点id的对应关系
    public static final String TGT_TID = _PREFIX + "tgt:pst";
    // 方位角计算所需的初始值，后缀测点id，类型 list [x,y,z]
    public static final String CAL_AZ_INIT = _PREFIX + "tgt:cal:az:init:";
    // 缓存阈值信息，数据处理程序需要，key 为 targetId_quotaCode
    public static final String TGT_WARN_TH = _PREFIX + "tgt:warn:th";
    // 接收告警用户信息
    public static final String TGT_WARN_USER = _PREFIX + "tgt:warn:user";


    public static final class EntityCacheKey {
        //秒级平均瞬时值
        public static final String SECMEAN = _PREFIX + "sm";
        //状态统计(项目状态、传感器状态）
        public static final String STATUS = _PREFIX + "status";
        //基本信息（项目类型，项目，传感器分组，传感器位置，传感器类型
        public static final String BASEINFO = _PREFIX + "bi";
        //传感器相关参数设置，阈值范围，理论值
        public static final String SETTINGS = _PREFIX + "set";
        //系统菜单权限相关信息
        public static final String SYSTEM = _PREFIX + "sys";
        //定时初始化任务
        public static final String DATA_INIT_TASK = _PREFIX + "task:init";
        //日志编号-巡检日志
        public static final String DATE_XJ = _PREFIX + "xj";
        //日志编号-验收日志
        public static final String DATE_YS = _PREFIX + "ys";
        //定时任务 获取执行告警已执行时间
        public static final String WARN_SMS = _PREFIX + "warn:sms";
    }

    //临时存储
    public static final String TEMP_REGION_KEY = _PREFIX + "temp:region:key";
    //需要进行缓存数据初始化
    public static final int DATA_INIT_YES = 1;
    //不需要进行缓存数据初始化
    public static final int DATA_INIT_NO = 0;


    public static final class InfluxTableKey {
        //原始数据
        public static final String RAW = "raw_";
        //秒级平均值
        public static final String SECMEAN = "secmean_";
    }

    public static final String JOB_RUN = _PREFIX + "job:run";

    public static final String JOB_RUN_SIMULATION_STATUS = _PREFIX + "job:run:ss";

    public static final String JOB_RUN_STEP = _PREFIX + "job:step";

    public static final String JOB_RUN_LAST = _PREFIX + "job:run:last";
}
